﻿using CookComputing.XmlRpc;

namespace tswe.channels
{
    public interface IMetaWeblog
    {
        #region MetaWeblog API

        [XmlRpcMethod("metaWeblog.newPost")]
        string NewPost(string blogid, string username, string password, Post post, bool publish);

        [XmlRpcMethod("metaWeblog.editPost")]
        bool UpdatePost(string postid, string username, string password, Post post, bool publish);

        [XmlRpcMethod("metaWeblog.getPost")]
        Post GetPost(string postid, string username, string password);

        [XmlRpcMethod("metaWeblog.deletePost")]
        [return: XmlRpcReturnValue(Description = "Returns true.")]
        bool DeletePost(string key, string postid, string username, string password, bool publish);

        [XmlRpcMethod("metaWeblog.getCategories")]
        CategoryInfo[] GetCategories(string blogid, string username, string password);

        [XmlRpcMethod("metaWeblog.getRecentPosts")]
        Post[] GetRecentPosts(string blogid, string username, string password, int numberOfPosts);

        [XmlRpcMethod("metaWeblog.newMediaObject")]
        MediaObjectInfo NewMediaObject(string blogid, string username, string password,
            MediaObject mediaObject);

        #endregion

        #region Blogger API

        [XmlRpcMethod("blogger.deletePost")]
        [return: XmlRpcReturnValue(Description = "Returns true.")]
        bool BloggerDeletePost(string key, string postid, string username, string password, bool publish);

        [XmlRpcMethod("blogger.getUsersBlogs")]
        BlogInfo[] GetUsersBlogs(string key, string username, string password);

        [XmlRpcMethod("blogger.getUserInfo")]
        UserInfo GetUserInfo(string key, string username, string password);

        #endregion

        #region WordPress API

        [XmlRpcMethod("wp.deleteCategory",
            Description = "Deletes a existing category")]
        string deleteCategory(string blogid, string username, string password, string categoryid);

        [XmlRpcMethod("wp.getCategories",
            Description = "Get all existing categories")]
        wpCategory[] getWpCategories(string blogid, string username, string password /*,object dummyCategory*/);

        [XmlRpcMethod("wp.getAuthors",
            Description = "Get all existing blog authors")]
        wpAuthor[] getAuthors(string blogid, string username, string password);

        [XmlRpcMethod("wp.getPostStatusList",
            Description = "Get all valid post statuses and their descriptions")]
        XmlRpcStruct getPostStatusList(string blogid, string username, string password);

        [XmlRpcMethod("wp.newCategory",
            Description = "Adds a new category")]
        string newCategory(string blogid, string username, string password, wpCategory category);

        #endregion
    }
}
